#ifndef _RFID_INTERFACE_H_
#define _RFID_INTERFACE_H_
#include <stdint.h>
#include "bsp_rfid.h"

#define BSP_RFID_V1		1
#define BSP_RFID_V2		2

#define BSP_RFID_VER	BSP_RFID_V1

#if BSP_RFID_VER == BSP_RFID_V2
//ADC = 250Khz  DMA = 2048  INT = 4096us
#define RFID_ITF_COLLECT_FREQ					(125000U * 2U)	//ADC采集频率
#define RFID_ITF_DMA_BUF_LEN					2048	//ADC-DMA缓冲长度
#else
#define RFID_ITF_COLLECT_FREQ					(125000U * 1U)	//ADC采集频率
#define RFID_ITF_DMA_BUF_LEN					512		//ADC-DMA缓冲长度
#endif 

#define RFID_ITF_ID_CARD_EN						1
#define RFID_ITF_HID_CARD_EN					1

typedef enum{
	RFID_ITF_TAG_ID = 0x01,
	RFID_ITF_TAG_HID = 0x02,
}rfid_itf_tag;

void rfid_itf_decode(uint16_t *adc_value, uint32_t len);
void rfid_itf_set_tag(uint8_t tag);
void rfid_itf_clr_tag(uint8_t tag);
uint8_t rfid_itf_read_flag(void);
void rfid_itf_write_flag(uint8_t tag);

#endif

